import { getAction, deleteAction, putAction, postAction, downFilePost, downFile, uploadAction } from '@/api/manage'
/**
 * 预案管理
 */

/*
预案类别
 */
//获取预案类别列表
const getTypeList = params => getAction(`/xl-plan-category/selectPage`,params)
const getTypeLints = () => getAction(`/xl-plan-category/list`)
//添加预案类别
const addType = params => postAction(`/xl-plan-category/save`,params)
//修改预案类别
const  reviseType = params => postAction(`/xl-plan-category/update`,params)
//删除预案类别
const deleteType = params => postAction(`/xl-plan-category/delete`,params)
//状态调整
const stateTypr = params => postAction(`/xl-plan-category/state`,params)

/*
预案管理
 */
//没有分页的列表
const getManageListAll = () => getAction(`/xl-reserve-plan/all`)
//列表
const getManageList = params => getAction(`/xl-reserve-plan/selectPage`,params);
//添加
const addManage = params => postAction(`/xl-reserve-plan/savePlan`,params);
//查看详情
const lookManage = params => getAction(`/xl-reserve-plan/planDetails/${params}`);
//编辑预案
const textManage = params => postAction(`/xl-reserve-plan/updatePlan`,params)
//删除预案
const stateManage = params => postAction(`/xl-reserve-plan/deletePlan`,params)
//预案类别列表
const getTypeLists = () => getAction(`/xl-plan-category/list`)
//重启预案
const relaunch = params => postAction(`/xl-reserve-plan/relaunch`,params)
/*
组织架构衍生
 */
//获取网格树
const getTree = () => getAction(`/xl-org/mesh/tree`)
//根据网格树获取人员信息
const getList = params => postAction(`/xl-org/user/list`,params)

/*
启动预案
 */
const postQidong = params => postAction(`/xl-reserve-plan/startPlan`,params)
/*
根据案事件获取对应预案
 */
const getPlan = params => getAction(`/xl-reserve-plan/getPlan`,params)

export {
  relaunch,
  getPlan,
  postQidong,
  getTypeLints,
  getList,
  getTree,
  getTypeList,
  addType,
  reviseType,
  deleteType,
  stateTypr,
  getManageListAll,
  getManageList,
  addManage,
  lookManage,
  textManage,
  stateManage,
  getTypeLists
}
